/* GameStarter.java
 * 
 * Alfred Olschnoegger
 * 24.05.2008
 */

package application;

import domain.game.GameManager;
import domain.location.GameArea;

/**
 * Controller to start a new game
 *
 * @date 24.05.2008
 * @author Alfred Olschnoegger
 */

public class GameStarter {
	
	GameInfoProvider m_Game = new GameInfoProvider();
	
	/**
	 * creates and starts a new game
	 * 
	 * @param name name of the game
	 * @param pos1Lat	1st latitude position
	 * @param pos1Long	1st longitude position
	 * @param pos2Lat	2nd latitude position
	 * @param pos2Long	2nd longitude position
	 * @param duration	game duration in sec
	 */
	public void startGame(String name, double pos1Lat, double pos1Long, double pos2Lat, double pos2Long, int duration) {
		
		m_Game.setGame(GameManager.getInstance().getNewGame(name, duration, new GameArea(pos1Lat,pos1Long,pos2Lat,pos2Long)));
		
		m_Game.start();
	}
	
	
	/**
	 * creates and starts a new game
	 * 
	 * @param name name of the game
	 * @param pos1Lat	1st latitude position
	 * @param pos1Long	1st longitude position
	 * @param pos2Lat	2nd latitude position
	 * @param pos2Long	2nd longitude position
	 */
	public void startGame(String name,double pos1Lat, double pos1Long, double pos2Lat, double pos2Long) {
		
		m_Game.setGame(GameManager.getInstance().getNewGame(name,-1, new GameArea(pos1Lat,pos1Long,pos2Lat,pos2Long)));
		
		m_Game.start();
	}
	
}


// end of GameStarter.java
